package com.jml.代理模式.五期.service.cglib.调试代理类;

import java.lang.reflect.Method;

import net.sf.cglib.proxy.MethodInterceptor;
import net.sf.cglib.proxy.MethodProxy;


public class CglibMethodInterceptor implements MethodInterceptor {
    /**
     * @param obj
     * @param method
     * @param args
     * @param proxy
     * @return
     * @throws Throwable
     */
    @Override
    public Object intercept(Object obj, Method method, Object[] args, MethodProxy proxy) throws Throwable {
        System.out.println(">>cglib动态代理执行开始<<");
        Object result = proxy.invokeSuper(obj, args);
        System.out.println(">>cglib动态代理执行结束<<");
        return result;
    }
}
